using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text.Json;
using CSharpKit.Extensions;
using CSharpKit.Native.ECCODES;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace csk.ntv.grib
{
    [TestClass]
    public class UnitTest_GRIB_get_box
    {
        [TestMethod]
        public void get_box()
        {
            Assert.IsTrue(true);

            var err = 0;
            var status = 0;
            var fname = "d:/sfxData/ecmwf/20200802.grib";
            var fin = eccodes.codes_fopen(fname, FileOpenModel.Read);
            // ----------------------------------------------------------------
            var c = eccodes.codes_context_get_default();
            var h = eccodes.codes_handle_new_from_file(IntPtr.Zero, fin, ProductKind.GRIB, out err);
            var box = eccodes.codes_box_new(h, ref err);
            var emsg = eccodes.codes_get_error_message(err);
            // "Function not yet implemented"




            status = eccodes.codes_handle_delete(h);
            // ----------------------------------------------------------------
            status = eccodes.codes_fclose(fin);

            Assert.IsTrue(true);
        }

        // {{END}}
    }

}


